<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
/*后台相关界面路由*/
Route::get('/admin', 'Admin\IndexController@Index')->middleware('auth');
Route::get('/admin/baseinfo.html', 'Admin\IndexController@BaseInfo')->middleware('auth');
Route::get('/admin/webset.html', 'Admin\IndexController@WebSetView')->middleware('auth');
Route::get('/admin/webcache.html', 'Admin\IndexController@WebCache')->middleware('auth');
Route::get('/admin/editlink/{id}.html', 'Admin\IndexController@EditLink')->middleware('auth');
Route::get('/admin/editqq/{id}.html', 'Admin\IndexController@EditQq')->middleware('auth');
Route::get('/admin/linklist.html', function () {
    return view('admin.linklist');
})->middleware('auth');
Route::get('/admin/qqlist.html', function () {
    return view('admin.qqlist');
})->middleware('auth');
Route::get('/admin/changeinfo.html', function () {
    return view('admin.changeinfo');
})->middleware('auth');
Route::get('/admin/addinterface.html', function () {
    return view('admin.addinterface');
})->middleware('auth');
Route::get('admin/addlink.html', function () {
    return view('admin.addlink');
})->middleware('auth');
Route::get('admin/addqq.html', function () {
    return view('admin.addqq');
})->middleware('auth');
Route::get('/admin/addad.html', function () {
    return view('admin.addad');
})->middleware('auth');
Route::get('/admin/thread.html', function () {
    return view('admin.thread');
})->middleware('auth');
Route::get('/admin/wechat.html', function () {
    return view('admin.wechat');
})->middleware('auth');
Route::get('/admin/update.html', function () {
    return view('admin.update');
})->middleware('auth');

/*后台相关动作执行路由*/
Route::post('/action/wconfig', 'Admin\ActionController@WConfig')->middleware('auth');
Route::post('/action/addlink', 'Admin\ActionController@Addlink')->middleware('auth');
Route::post('/action/addqq', 'Admin\ActionController@AddQq')->middleware('auth');
Route::post('/action/changeinfo', 'Admin\ActionController@ChangeInfo')->middleware('auth');
Route::post('/action/editlink', 'Admin\ActionController@EditLink')->middleware('auth');
Route::post('/action/editqq', 'Admin\ActionController@EditQq')->middleware('auth');
Route::post('/action/delete', 'Admin\ActionController@DeleteData')->middleware('auth');
Route::post('/action/clearcache', 'Admin\ActionController@ClearCache')->middleware('auth');

/*爬虫控制路由*/
Route::get('/', 'Index\IndexController@IndexView')->middleware('webcache:' . laracvs('webcache.timeout'));
Route::get('videolist/{type}-{cat}-{pg}.html', 'Index\IndexController@VideoList')->middleware('webcache:' . laracvs('webcache.timeout'));
Route::get('chazhao', 'Index\IndexController@SearchView');
Route::get('{ym}/{type}/{url}.html', 'Index\IndexController@DetailPlayView')->middleware('qq');
Route::get('/qrcode', 'Index\IndexController@Qrcode');

/*安装路由*/
Route::any('/install/{id}','Common\InstallController@install');
Route::get('/install','Common\InstallController@install');
Route::get('yzmysql','Common\InstallController@yzMysql');

/*微信相关路由*/
Route::any('/laracvs_wechat', 'Wechat\WechatController@serve');
Route::any('/menu', 'Wechat\WechatController@menu_add');

/*更新*/
Route::post('/action/update',"Admin\ActionController@Update");
Auth::routes();

